--- Makefile.orig	2008-03-24 08:07:37.000000000 +0100
+++ Makefile	2010-10-22 17:57:38.291774433 +0200
@@ -2,7 +2,7 @@
 INSTALLPROG=install
 INSTALLROOT=
 INSTALLARGS=
-PREFIX=/usr/local
+PREFIX=${DESTDIR}/usr
 BINDIR=bin
 BINPERM=0755
 # Might use: MANDIR=share/man
@@ -35,12 +35,14 @@
 install: all install-bin install-man
 
 install-bin: $(SCRIPTNAME)
+	mkdir -m755 -p $(PREFIX)/$(BINDIR)
 	$(INSTALLPROG) -m $(BINPERM) $(INSTALLARGS) $(SCRIPTNAME) $(INSTALLROOT)$(PREFIX)/$(BINDIR)
 
 # making the man-page is dependent upon files not distributed, so they're
 # regenerated, so we don't list it as a dependency here -- instead we
 # assume that the maintainer created it for us (as a tarball depenency)
 install-man:
+	mkdir -m755 -p $(PREFIX)/$(MANDIR)/$(MANSECTDIR)
 	$(INSTALLPROG) -m $(MANPERM) $(INSTALLARGS) $(MANPAGE) $(INSTALLROOT)$(PREFIX)/$(MANDIR)/$(MANSECTDIR)
 
 bin $(SCRIPTNAME): $(SCRIPTSRC)
